<?php 
/*
 * @author qianfunian
 */
require('./configs/config.php');
session_start();
include 'header.php';
if($_SERVER['REQUEST_METHOD']=='POST')
{
	extract($_POST);
	$isOK = $db->insert('s_category', array('category'=>$category,'remark'=>$remark))?:0;
	$smarty->assign('isOK',$isOK);
}
$categorys = $db->get_all("select * from `s_category`");
$smarty->assign('categorys',$categorys);

$smarty->display('add-category.tpl');
?>